package com.kaifa.org.tp02.example06.bean;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//指定JavaBean
@Component("user")
//指定JavaBean的作用域
@Scope("singleton")
@Getter
@Setter

public class User {
//    Bean的实例的注入
    @Value("1")
    private int id;
    @Value("zjj2")
    private String loginName;
    @Value("123456789")
    private String loginPwd;


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", loginName='" + loginName + '\'' +
                ", loginPwd='" + loginPwd + '\'' +
                '}';
    }
}
